# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.NetworkAttachmentConnectedEndpoint do
  @moduledoc """
  [Output Only] A connection connected to this network attachment.

  ## Attributes

  *   `ipAddress` (*type:* `String.t`, *default:* `nil`) - The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
  *   `ipv6Address` (*type:* `String.t`, *default:* `nil`) - The IPv6 address assigned to the producer instance network interface. This is only assigned when the stack types of both the instance network interface and the consumer subnet are IPv4_IPv6.
  *   `projectIdOrNum` (*type:* `String.t`, *default:* `nil`) - The project id or number of the interface to which the IP was assigned.
  *   `secondaryIpCidrRanges` (*type:* `list(String.t)`, *default:* `nil`) - Alias IP ranges from the same subnetwork.
  *   `status` (*type:* `String.t`, *default:* `nil`) - The status of a connected endpoint to this network attachment.
  *   `subnetwork` (*type:* `String.t`, *default:* `nil`) - The subnetwork used to assign the IP to the producer instance network interface.
  *   `subnetworkCidrRange` (*type:* `String.t`, *default:* `nil`) - [Output Only] The CIDR range of the subnet from which the IPv4 internal IP was allocated from.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :ipAddress => String.t() | nil,
          :ipv6Address => String.t() | nil,
          :projectIdOrNum => String.t() | nil,
          :secondaryIpCidrRanges => list(String.t()) | nil,
          :status => String.t() | nil,
          :subnetwork => String.t() | nil,
          :subnetworkCidrRange => String.t() | nil
        }

  field(:ipAddress)
  field(:ipv6Address)
  field(:projectIdOrNum)
  field(:secondaryIpCidrRanges, type: :list)
  field(:status)
  field(:subnetwork)
  field(:subnetworkCidrRange)
end

defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.NetworkAttachmentConnectedEndpoint do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.NetworkAttachmentConnectedEndpoint.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.NetworkAttachmentConnectedEndpoint do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
